// JavaScript Document
function point_it(event)
	{
		var pointer_div = document.getElementById("pointer_div");
		var pointer = document.getElementById("pointer");
	
		//mouse coords
		pos_x = event.offsetX ? (event.offsetX) : event.pageX - pointer_div.offsetLeft;
		pos_y = event.offsetY ? (event.offsetY) : event.pageY - pointer_div.offsetTop;
	
		  switch(running){
			case 1:
				  //first click
				  document.pointform.x.value = pos_x;
				  document.pointform.y.value = pos_y;
			  break;
			case 2:
				//second click
			  break;
			case 3:
				  //third reset click
				  document.pointform.x.value = "";
				  document.pointform.y.value = "";
				  document.pointform.width.value = "";
				  document.pointform.height.value = "";
			  break;
		  }
	
	  fx(pos_y,pos_x);
	}

running=1;
click_="";
var t, l, b, r="";
function fx(top,left){

	switch(running){
		case 1:
			t=top;
			l=left;
			running=2;
			break;
		case 2:
			b=top;
			r=left;
			element = document.createElement("div");
			element.setAttribute("id","pointer");
			element.setAttribute("style", "background-color:#FF0000;opacity:0.6;-moz-opacity:0.2;width:"+(r-l)+"px;height:"+(b-t)+"px;border:2px solid #000;position:relative;top:"+t+"px;left:"+l+"px;");
			pointer_div.appendChild(element);
			document.pointform.width.value = r-l;
  		    document.pointform.height.value = b-t;
			running=3;
			break;
		case 3:
			current = pointer;
			current.parentNode.removeChild(current);
			running=1;
			break;
	}
}